package com.xiaofei.Tools;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;//响应吗
    private String msg;//提示信息
    private Object data;//返回数据
    public static Result success(){
        Result result = new Result();
        result.setCode(1);
        result.setMsg("操作成功");
        return result;
    }
    public static Result success(Object data){
        Result result = new Result();
        result.setCode(2);
        result.setMsg("操作成功");
        result.setData(data);
        return result;
    }
    public static Result error(String msg){
        Result result = new Result();
        result.setCode(0);
        result.setMsg(msg);
        return result;
    }
}
